import Vue from 'vue';
import Router from 'vue-router';
import mainRouter from '@/views/main/router'
import errorpage from '@/views/errorpage/router'
Vue.use(Router);
let routes = [
    ...mainRouter,
    ...errorpage
]   

let router = new Router({
    mode: 'history',  //去掉url中的#
    routes
})
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
    return originalPush.call(this, location).catch(err => err)
}
export default router